﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Controls="clr-namespace:Demo.Controls"
    xmlns:Borders="clr-namespace:ToggleSwitch.Borders;assembly=ToggleSwitch" 
    xmlns:Demo="clr-namespace:Demo" xmlns:Utils="clr-namespace:Demo.Utils" x:Class="Demo.MainPage" 
    DataContext="{StaticResource DemoViewModel}"
    mc:Ignorable="d"
    d:DesignHeight="600" d:DesignWidth="800">

  <UserControl.Resources>
    <Utils:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
  </UserControl.Resources>

  <Grid>
        <Controls:TiledBackground SourceUri="/Demo;component/Images/bgTexture.png" />
        <Image Source="Images/glow.png" Stretch="Fill" Opacity="0.35" />
        <Borders:ClippingBorder CornerRadius="8" HorizontalAlignment="Center" VerticalAlignment="Center">
            <Grid Background="#FFF0F3F8" Width="660" Height="440">
                <Controls:TiledBackground SourceUri="/Demo;component/Images/pattern.png" />
                <Grid Margin="50">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <StackPanel x:Name="LinksStackPanel" Orientation="Horizontal">
                        <RadioButton Style="{StaticResource LinkStyle}" x:Name="BasicsLink" Content="BASICS" IsChecked="True" Margin="0,0,25,0"/>
                        <RadioButton Style="{StaticResource LinkStyle}" x:Name="StylingLink" Content="STYLING" />
                        <RadioButton Style="{StaticResource LinkStyle}" x:Name="EventsLink" Content="EVENTS" />
                        <RadioButton Style="{StaticResource LinkStyle}" x:Name="ExtendingLink" Content="EXTENDING" Margin="25,0,0,0"/>
                    </StackPanel>
                    <Grid Grid.Row="1" Margin="0,40,0,0">
                        <Demo:Basics Visibility="{Binding IsChecked, ElementName=BasicsLink, Converter={StaticResource BoolToVisibilityConverter}}"/>
                        <Demo:Styling Visibility="{Binding IsChecked, ElementName=StylingLink, Converter={StaticResource BoolToVisibilityConverter}}"/>
                        <Demo:Events Visibility="{Binding IsChecked, ElementName=EventsLink, Converter={StaticResource BoolToVisibilityConverter}}"/>
                        <Demo:Extending Visibility="{Binding IsChecked, ElementName=ExtendingLink, Converter={StaticResource BoolToVisibilityConverter}}"/>
                    </Grid>
                </Grid>
            </Grid>
        </Borders:ClippingBorder>
        <Grid x:Name="ErrorPanel" Visibility="Collapsed" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Border Background="{StaticResource PageOverlayBrush}">
                <TextBlock Text="Error:" 
                			Padding="12,12,0,0" 
                			Foreground="White" 
                			FontSize="{StaticResource NavigationFontSize}" 
                			FontFamily="{StaticResource ContentFontFamily}"/>
            </Border>
            <TextBox x:Name="ErrorConsole" Grid.Row="1"
                		IsReadOnly="True" 
                		VerticalScrollBarVisibility="Auto" 
                		HorizontalScrollBarVisibility="Auto" 
                		FontFamily="{StaticResource ContentFontFamily}" 
                		Style="{StaticResource ErrorConsoleStyle}" 
                		FontSize="{StaticResource ContentFontSize}" 
                		Padding="12"/>
        </Grid>
    </Grid>
</UserControl>
